Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs_vnops_os.c: fallocate is valid but not supported on FreeBSD #16918

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

pstef
Copy link
Contributor

@pstef pstef commented Jan 2, 2025

This works around
/usr/lib/go-1.18/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument

It happened to me under a Linux jail, but it also happened to other people, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270247#c4

I've been running this on my laptop for months with success and no new errors.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

This works around
/usr/lib/go-1.18/pkg/tool/linux_amd64/link:
mapping output file failed: invalid argument

It's happened to me under a Linux jail, but it's also happened to other
people, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270247#c4

Signed-off-by: pstef <[email protected]>
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From one side POSIX does not define this error code for posix_fallocate(), probably expecting emulation via writing, which could be implemented by vop_stdallocate() here. But writing makes no sense for ZFS. From another side Linux posix_fallocate() man page documents EOPNOTSUPP as possible error for libc implementation not providing emulation.

So I lean to agree that VOP_EOPNOTSUPP is indeed better than VOP_EINVAL, but open to other thoughts in general in case I miss something.

@amotin amotin added the Status: Code Review Needed Ready for review and testing label Jan 2, 2025
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this seems like the way to go. We do return EOPNOTSUPP on the Linux side for this case as well.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jan 2, 2025
@behlendorf behlendorf merged commit 478b095 into openzfs:master Jan 3, 2025
24 of 25 checks passed
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jan 3, 2025
This works around
/usr/lib/go-1.18/pkg/tool/linux_amd64/link:
mapping output file failed: invalid argument

It's happened to me under a Linux jail, but it's also happened to other
people, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270247#c4

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: pstef <[email protected]>
Closes openzfs#16918
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants